package cn.tedu.api;

import java.util.*;

//测试 Map接口
public class Test4_Map {
    public static void main(String[] args) {
        Map<Integer, String> map = new HashMap<>();
        Map<Integer, String> map2 = new HashMap<>();
        map.put(9527,"唐伯虎");
        map.put(9528,"如花");
        map.put(9526,"秋香");
        map.put(4396,"厂长");
        map.containsKey(9527);
        map.containsValue("厂长");
        map.equals(4396);
        map.get(4396);
        map.get(2200);
        map.hashCode();
        map.isEmpty();
        map.put(2200,"销户");
        map2.putAll(map);
        map.remove(9528);
        map.size();
        map2.clear();
        Set<Integer> set = map.keySet();
        for (Integer k:
             set) {
            System.out.println(k+":::"+map.get(k));
        }
        Collection<String> collection = map.values();
        for (String v :
                collection) {
            System.out.println(v);
        }
        Set<Map.Entry<Integer,String >> set2 = map.entrySet();
        for (Map.Entry<Integer,String > m:
             set2) {
            Integer key = m.getKey();
            String value = m.getValue();
            System.out.println(key + "====" + value);
            System.out.println(m);

        }
    }
}
